WEBVTT

00:00.620 --> 00:06.650
In the last part we found out that our customized healthcare sector index showed that the second highest

00:06.650 --> 00:10.460
chop ratio and we presented this to our client Mary.

00:10.760 --> 00:16.910
However the results of Part 5 supported Mary's belief that the health care sector is the one and only

00:16.910 --> 00:19.270
sector to be invested in.

00:19.350 --> 00:26.780
And she says even if the consumer services sector showed a better Sharpe ratio and a higher return than

00:26.780 --> 00:33.380
the healthcare sector the risk is simply too high and that there's no benefit to add other sectors with

00:33.560 --> 00:36.240
lower Sharpe ratio than the healthcare sector.

00:36.350 --> 00:42.980
Because this will not improve the shop ratio of the overall portfolio and therefore I will stick to

00:42.980 --> 00:44.940
my current stock portfolio.

00:45.050 --> 00:48.230
So that's the marriage statement here and our argument.

00:48.230 --> 00:56.390
Past performance is no guarantee or no indicator of future results did not impress her much and I mean

00:56.390 --> 01:02.270
Mary's arguments are reasonable for a person who is not an expert in finance and investments but they

01:02.270 --> 01:08.390
are nevertheless wrong because they do not take into account the portfolio diversification effect and

01:08.390 --> 01:13.790
that means that by creating a portfolio with many sectors we can reduce the sector specific risk not

01:13.790 --> 01:18.350
only for the healthcare sector but also for the other sectors.

01:18.440 --> 01:24.770
And that's why there still a good chance to find portfolios that so a better Sharpe ratio with the same

01:24.770 --> 01:30.140
or lower risk than the health care sector on a standalone basis.

01:30.140 --> 01:36.680
And our client Mary might not be an easy person but she is definitely open to a reasonable and well-founded

01:36.710 --> 01:45.410
arguments and therefore we will create 50000 random portfolios and show her that she could have done

01:45.440 --> 01:49.940
even better with a higher degree of diversification in her portfolio.

01:49.940 --> 01:53.720
All right let's stop coding here and we have still important here.

01:53.720 --> 02:03.000
Our returns state frame with the daily returns of the sectors here and in total we have 11 sectors or

02:03.000 --> 02:11.210
eleven assets and we tried to simulate 50000 random portfolios number of portfolios.

02:11.210 --> 02:17.120
And then on the next step we create the fifty thousand times eleven the random numbers between 0 and

02:17.120 --> 02:24.290
1 and we reshape them in two or fifty thousand rows and eleven columns and we save them in the variable

02:24.290 --> 02:28.200
matrix and we set to the random C 2 1 1 1.

02:28.310 --> 02:37.400
So this shows actually a reproducibility here and let's do this and then we transform our random numbers

02:37.400 --> 02:45.410
into weights where for each and every of the 50000 portfolios the weights of the constituent sum up

02:45.410 --> 02:46.390
to 1.

02:46.970 --> 02:55.330
And we save the weights matrix and the variable weights so here we have fifty thousand portfolios with

02:55.390 --> 03:01.720
eleven constituents and we can also have a look here at the very first portfolios.

03:01.750 --> 03:10.840
So here is one portfolio with a 13 percent for the very first asset and so on and having the daily returns

03:10.840 --> 03:18.760
of the eleven constituents and the random weights we can actually create the daily returns of our fifty

03:18.760 --> 03:26.500
thousand random portfolios by using here the top method and actually we are performing a matrix multiplication

03:27.490 --> 03:34.900
and uh we save um the daily returns of the fifty thousand portfolios and the variable part read and

03:34.930 --> 03:36.330
let's have a look here.

03:36.340 --> 03:43.590
So here we have fifty thousand columns and fifty thousand portfolios then in the next set we can calculate

03:43.590 --> 03:50.940
the annualized the risk and return for those portfolios by simply passing our data frame portfolio returns

03:51.420 --> 03:57.130
to our user defined function annualized the risk and return and be safe.

03:57.180 --> 04:00.480
The summary here and the variable portfolio summary.

04:00.480 --> 04:03.810
So this is the most time consuming step here

04:07.930 --> 04:15.430
and let's have a look at the portfolio summary data frame so here we have uh the annualized the return

04:15.430 --> 04:20.530
and the annualized risk for fifty thousand random portfolios.

04:20.530 --> 04:26.890
And then the next step we can visualize the fifty thousand portfolios in a total risk return framework

04:28.270 --> 04:35.350
and again we are creating the scatter plot twists on the x axis the risk column and on the y axis the

04:35.350 --> 04:36.650
return column.

04:36.850 --> 04:39.560
And we also plot our 11 indexes.

04:39.610 --> 04:40.860
So let's have a look here.

04:45.900 --> 04:49.260
And that's actually our cloud of potential portfolios.

04:49.260 --> 04:51.680
And here we have the efficient frontier.

04:51.930 --> 04:59.510
And this is near our healthcare index and at a first glance we can see that there are indeed portfolios

05:00.080 --> 05:02.140
that have actually the same risk.

05:02.140 --> 05:06.890
Yes our healthcare index on a standalone basis but deliver more return.

05:06.890 --> 05:14.960
So here and are even portfolios that have less risk and at least the same return as our health care

05:14.960 --> 05:15.380
index.

05:15.380 --> 05:23.660
So here for example and finally we can also calculate the SAP ratio for our 50000 portfolios.

05:23.800 --> 05:31.400
So we are creating the additional column sharp and that's our portfolio summary data frame with the

05:31.400 --> 05:41.050
addition column sharp and we can also call the scribe method here and here we can see that the maximum

05:41.050 --> 05:48.520
Sharpe ratio is one point fourteen one and then we can also get the index label of the max swap rates

05:48.520 --> 05:52.180
for portfolio with the idea X Max method

05:55.120 --> 06:03.100
and the index label of the max Sharpe ratio is the forty six thousand nine hundred fifty seven and we

06:03.100 --> 06:10.300
can also select a complete row with our Max Sharpe Ratio portfolio and here we have a return of 17 percent

06:10.330 --> 06:17.620
and they risk off thirteen point seven percent resulting in a sharp ratio of one point fourteen and

06:17.680 --> 06:28.930
let's compare this also to our health care index and here we had a return of about 14 percent and a

06:28.930 --> 06:31.740
risk of fourteen point three percent.

06:31.870 --> 06:37.240
So the max Sharpe Ratio portfolio delivered actually a lower risk and higher return.

06:37.240 --> 06:40.410
And of course then also a higher Sharpe ratio.

06:40.480 --> 06:48.040
And last but not least we can also get the rates of the constituents and the max Sharpe Ratio portfolio.

06:48.040 --> 06:57.660
So let's also create a pen a serious and we can see that we have in the MAX Sharpe Ratio portfolio high

06:57.660 --> 06:59.550
rates of the health care index.

06:59.550 --> 07:01.560
So that's no surprise.

07:01.560 --> 07:09.330
And also of the Consumer Services Index and actually finally we presented our results to marry and showed

07:09.330 --> 07:12.740
her the portfolio diversification effect.

07:12.870 --> 07:20.960
And uh finally we could manage to convince Mary to diversify her stock portfolio so for the future she

07:20.960 --> 07:25.450
will also add some more sectors to her health care portfolio.

07:25.760 --> 07:29.130
And we will do this in the very last step Step 7.

07:29.210 --> 07:31.190
And I hope to see you there by.
